import classNames from 'classnames'
import styles from './index.module.less'
import { Toast } from 'antd-mobile'

interface IProps {
    url: string
}
/**     */
const FooterBar: React.FC<IProps> = ({ url }) => {
    const goToMine = () => {
        const domain = window.location.origin

        if (!url) {
            Toast.show('未配置中台移动端')
            return
        }

        window.location.href = `${url}/mine?fromApplication=jyyz&backUrl=${encodeURIComponent(domain)}`
    }

    return (
        <>
            <div className={styles.footer_bar}>
                <div className={styles.tab_bar_inner}>
                    <div className={classNames(styles.tab_bar_item, styles.active)}>
                        {/* <img src="https://static.zpimg.cn/public/job_fe_h5/images/icon_home_no_active.jpg" alt="icon_user" /> */}
                        <img src="https://img-test.zpimg.cn/public_read/user_logo/17489661cpd83n5s.png" alt="icon_user" />
                        <div className={classNames(styles.label)}>首页</div>
                    </div>

                    <div className={styles.tab_bar_item} onClick={goToMine}>
                        <img src="https://wtzp-static.oss-cn-hangzhou.aliyuncs.com/public/job_fe_h5/images/icon_geren_n.png" alt="icon_user" />
                        <div className={styles.label}>我的</div>
                    </div>
                </div>
            </div>
        </>
    )
}

export default FooterBar
